package com.animation_study.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.SpannableString;
import android.text.Spanned;
import android.widget.TextView;

import com.animation_study.R;
import com.animation_study.span.ColorSpan;

public class SpanActivity extends AppCompatActivity {
    private TextView tv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_span);
        tv = (TextView) findViewById(R.id.tv);
        SpannableString spannableString = new SpannableString("hello, world, 学习");
        spannableString.setSpan(new ColorSpan(), 0, 5, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
        tv.setText(spannableString);
    }


}
